<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <table border="1" cellspacing="0" align="center">
    <caption>商品信息详情</caption>
    <tr>
      <th>商品种类</th>
      <td>过季旧款</td>
      <td>当前热销</td>
      <td>秋季新品</td>
    </tr>
    <tr>
      <th>商品状态</th>
      <td id="down">已下架</td>
      <td class="up"><span>热卖中</span></td>
      <td class="up">等待上架</td>
    </tr>
  </table>
  <script>
    // 通过id获取元素
    var downGoods = document.getElementById('down');
    // 通过innerHTML属性获取元素内容
    console.log(downGoods.innerHTML);
    // 通过类名获取元素
    var upGoods = document.getElementsByClassName('up');
    // 通过innerHTML属性获取元素内容
    console.log(upGoods[0].innerHTML);
    // 通过赋值语句设置元素内容
    upGoods[1].innerHTML = '已上架';
  </script>
</body>
</html>